package com.xg.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Map;

@Controller
//@RestController
public class TestController {


//    @RequestMapping({"/", "/login.html"})
//    public String index() {
//        return "index";
//    }



    @ResponseBody
    @RequestMapping("/test")
    public String test(){

        return "test !!!";
    }

    @RequestMapping("/success")
    public String success(Map<String ,Object> map){
        map.put("hello","<h1>你好！</h1>");
        map.put("users", Arrays.asList("xiaoge","tomcat","test","<h1>scott</h1>"));



        //classpath:/templates/success.html
        return "success";
    }


}

